<?php

class Khoa_thi extends Eloquent {
	public $timestamps = false;
	protected $table = 'khoa_this';
	protected $guarded = array();

	public static $rules = array(
		'ma_khoa_thi' => array('required','min:6','unique:khoa_this'),
		'ngay_thi' => 'required',
		'HoiDongThi_Id' => 'required'
	);

	public function ds_nam_khoa_thi()
	{
		$nam = DB::select('select DISTINCT YEAR(STR_TO_DATE(ngay_thi,"%d/%m/%Y")) as nam_khoa_thi from khoa_this order By nam_khoa_thi DESC');
        return $nam;
	}

}
